var QQMapWX = require('../../libs/qqmap-wx-jssdk.js');
var qqmapsdk;
Page({
  data: {
  },
  onLoad: function (options) {
    qqmapsdk = newQQMapWX({
      key: 'F7LBZ-UTHA5-YDCIU-Q6YRX-OYTUH-7KB3H'
    });
  },
  onReady: function () {
    var that = this
    wx.getLocation({
      type: 'wgs84',
      success: function (res) {
        console.log(res)
        var latitude1 = res.latitude
        var longitude1 = res.longitude
        qqmapsdk.reverseGeocoder({
          location: {
            latitude: latitude1,
            longitude: longitude1
          },
          success: function (res) {
            console.log(res);
            var add = res.result.address
            that.setData({
              wd: latitude1,
              jd: longitude1,
              address: add
            })
          }
        });
      }
    },
  )}
})